<?php
namespace app\warehouse\model;

use think\Model;
use think\Db;
class Purchase extends Model
{
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    // 自动写入时间戳
    protected $autoWriteTimestamp = true;


	public function getAdminIdTextAttr($value)
	{
		$name = Db::name('system_user')->where('id',$value)->value('nick');
		return $name;
	} 
	public function getShopNameAttr($value)
	{
		$name = Db::name('shop')->where('id',$value)->value('name');
		return $name;
	}  

	public function getWarehouseNameAttr($value)
	{
		$name = Db::name('warehouse')->where('id',$value)->value('name');
		return $name;
	}  
 

}
